

//
//  LTView.m
//  UI03_CustomView
//
//  Created by dllo on 16/5/5.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LTView.h"

@implementation LTView

#pragma mark - Creating and Init
+ (instancetype)ltviewWithFrame:(CGRect)frame title:(NSString *)title placeholder:(NSString *)placeholder{

    LTView *view = [[LTView alloc] initWithFrame:frame];
   //创建子控件
    view.label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width / 3,frame.size.height)];
    [view addSubview:view.label];
    [view.label release];
    
    view.textfield = [[UITextField alloc] initWithFrame:CGRectMake(frame.size.width / 3, 0, frame.size.width * 2 / 3, frame.size.height)];
        [view addSubview:view.textfield];
    [view.textfield release];
    
    
    //配置子控件
    [view configwithtitle:title placehoelder:placeholder];
    
    return [view autorelease];
}

- (void)configwithtitle:(NSString *)titel placehoelder:(NSString *)placeholder{

    self.label.text = titel;
    self.textfield.placeholder = placeholder;
    self.textfield.borderStyle = UITextBorderStyleRoundedRect;
}











@end
